package vashion.azeroth.core.personal.tran.pojo;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

import org.codehaus.jackson.annotate.JsonIgnore;

import vashion.azeroth.common.date.DateUtil;
import vashion.azeroth.common.math.BigDecimalUtil;
import vashion.azeroth.core.pojo.BaseObject;
import vashion.azeroth.core.support.StatusNameTransform;

import com.sun.org.apache.xerces.internal.impl.xpath.regex.ParseException;

public class PersonalDisburse extends BaseObject {

	private static final long serialVersionUID = -4041783651666429893L;

	private String disburseNo;
	
    private Long sellerMemberId;
    
    private String sellerMemberName;

    private Long buyerMemberId;

    private String buyerMemberName;

    private Integer status;

    /**结算总价**/
    private Long totalPrice;
    /**订单总价**/
    private Long orderTotalPrice;

    private String addressDetail;

    private Integer zipCode;

    private String receiveName;

    private String phone;

    private String logisticsCompany;

    private String logisticsNo;

    private Date timeFinished;
    private Date timeSendGoods;
    private Date timeAdd;
    @JsonIgnore
    private Date timeEdit;
    @JsonIgnore
    private String userAdd;
    @JsonIgnore
    private String userEdit;
    @JsonIgnore
    private String remark;
    private Long expired;
    private List<PersonalSnapshot> snapshots;
    @JsonIgnore
    private Long refundAmount;
    private String defAddr;
    private PersonalSnapshot snapshot;
    private Integer selfTake;
    private String sellerNickName;
    private String  buyerNickName;
    private String certificatePic;
    private String bank;
    private String realName;
    @JsonIgnore
    private Long memberId;
    @JsonIgnore
    private String type;
    private List<PersonalSnapshotSku> skus;
    private String refuseReason;
    private Long orderTotalPriceOld;
    
    public String getStatusName() {
    	return StatusNameTransform.getDisburseStatusName(status);
    }
    
    public String getTotalPriceShow() {
    	return BigDecimalUtil.divide(new BigDecimal(totalPrice), new BigDecimal(100)).toString();
    }
    
    public String getOrderTotalPriceShow() {
    	if(null == orderTotalPrice) {
    		return "";
    	}
    	return BigDecimalUtil.divide(new BigDecimal(orderTotalPrice), new BigDecimal(100)).toString();
    }
    
    public String getSelfTakeName() {
    	if(selfTake == 0) {
    		return "自提";
    	} else {
    		return "非自提";
    	}
    }

    public String getDisburseNo() {
        return disburseNo;
    }

    public void setDisburseNo(String disburseNo) {
        this.disburseNo = disburseNo;
    }

    public Long getSellerMemberId() {
		return sellerMemberId;
	}

	public void setSellerMemberId(Long sellerMemberId) {
		this.sellerMemberId = sellerMemberId;
	}

	public String getSellerMemberName() {
        return sellerMemberName;
    }

    public void setSellerMemberName(String sellerMemberName) {
        this.sellerMemberName = sellerMemberName;
    }


    public Long getBuyerMemberId() {
		return buyerMemberId;
	}

	public void setBuyerMemberId(Long buyerMemberId) {
		this.buyerMemberId = buyerMemberId;
	}

	public String getBuyerMemberName() {
        return buyerMemberName;
    }

    public void setBuyerMemberName(String buyerMemberName) {
        this.buyerMemberName = buyerMemberName;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public Long getTotalPrice() {
        return totalPrice;
    }

    public void setTotalPrice(Long totalPrice) {
        this.totalPrice = totalPrice;
    }

    public String getAddressDetail() {
        return addressDetail;
    }

    public void setAddressDetail(String addressDetail) {
        this.addressDetail = addressDetail;
    }

    public Integer getZipCode() {
        return zipCode;
    }

    public void setZipCode(Integer zipCode) {
        this.zipCode = zipCode;
    }

    public String getReceiveName() {
        return receiveName;
    }

    public void setReceiveName(String receiveName) {
        this.receiveName = receiveName;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getLogisticsCompany() {
		return logisticsCompany;
	}

	public void setLogisticsCompany(String logisticsCompany) {
		this.logisticsCompany = logisticsCompany;
	}

	public String getLogisticsNo() {
        return logisticsNo;
    }

    public void setLogisticsNo(String logisticsNo) {
        this.logisticsNo = logisticsNo;
    }

    public Date getTimeFinished() {
        return timeFinished;
    }

    public void setTimeFinished(Date timeFinished) {
        this.timeFinished = timeFinished;
    }

    public Date getTimeAdd() {
        return timeAdd;
    }

    public void setTimeAdd(Date timeAdd) {
        this.timeAdd = timeAdd;
    }

    public Date getTimeEdit() {
        return timeEdit;
    }

    public void setTimeEdit(Date timeEdit) {
        this.timeEdit = timeEdit;
    }

    public String getUserAdd() {
        return userAdd;
    }

    public void setUserAdd(String userAdd) {
        this.userAdd = userAdd;
    }

    public String getUserEdit() {
        return userEdit;
    }

    public void setUserEdit(String userEdit) {
        this.userEdit = userEdit;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

	public List<PersonalSnapshot> getSnapshots() {
		return snapshots;
	}

	public void setSnapshots(List<PersonalSnapshot> snapshots) {
		this.snapshots = snapshots;
	}

	public Long getExpired() {
		return expired;
	}

	public void setExpired(Long expired) {
		this.expired = expired;
	}

	public Long getRefundAmount() {
		return refundAmount;
	}

	public void setRefundAmount(Long refundAmount) {
		this.refundAmount = refundAmount;
	}

	public Date getTimeSendGoods() {
		return timeSendGoods;
	}

	public void setTimeSendGoods(Date timeSendGoods) {
		this.timeSendGoods = timeSendGoods;
	}

	public String getDefAddr() {
		return defAddr;
	}

	public void setDefAddr(String defAddr) {
		this.defAddr = defAddr;
	}

	public PersonalSnapshot getSnapshot() {
		return snapshot;
	}

	public void setSnapshot(PersonalSnapshot snapshot) {
		this.snapshot = snapshot;
	}

	public Integer getSelfTake() {
		return selfTake;
	}

	public void setSelfTake(Integer selfTake) {
		this.selfTake = selfTake;
	}

	public String getSellerNickName() {
		return sellerNickName;
	}

	public void setSellerNickName(String sellerNickName) {
		this.sellerNickName = sellerNickName;
	}

	public String getBuyerNickName() {
		return buyerNickName;
	}

	public void setBuyerNickName(String buyerNickName) {
		this.buyerNickName = buyerNickName;
	}

	public String getCertificatePic() {
		return certificatePic;
	}

	public void setCertificatePic(String certificatePic) {
		this.certificatePic = certificatePic;
	}

	public String getBank() {
		return bank;
	}

	public void setBank(String bank) {
		this.bank = bank;
	}

	public String getRealName() {
		return realName;
	}

	public void setRealName(String realName) {
		this.realName = realName;
	}
	
	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}
	
	public String getRefuseReason() {
		return refuseReason;
	}

	public void setRefuseReason(String refuseReason) {
		this.refuseReason = refuseReason;
	}

	public Long getMemberId() {
		return memberId;
	}

	public void setMemberId(Long memberId) {
		this.memberId = memberId;
	}
	
	public List<PersonalSnapshotSku> getSkus() {
		return skus;
	}

	public void setSkus(List<PersonalSnapshotSku> skus) {
		this.skus = skus;
	}

	public Long getOrderTotalPrice() {
		return orderTotalPrice;
	}

	public void setOrderTotalPrice(Long orderTotalPrice) {
		this.orderTotalPrice = orderTotalPrice;
	}

	public Long getOrderTotalPriceOld() {
		return orderTotalPriceOld;
	}

	public void setOrderTotalPriceOld(Long orderTotalPriceOld) {
		this.orderTotalPriceOld = orderTotalPriceOld;
	}

	public String getTimeAddStr() {
		try {
			return DateUtil.dateFormat(DateUtil.ymdhms_DATE_FORMAT, DateUtil.ymdhmsFormat(timeAdd));
		} catch (ParseException e) {
			e.printStackTrace();
		} catch (java.text.ParseException e) {
			e.printStackTrace();
		}
		return "";
	}
	
	public String getTimeEditStr() {
		try {
			return DateUtil.dateFormat(DateUtil.ymdhms_DATE_FORMAT, DateUtil.ymdhmsFormat(timeEdit));
		} catch (ParseException e) {
			e.printStackTrace();
		} catch (java.text.ParseException e) {
			e.printStackTrace();
		}
		return "";
	}
    
}